#include <xp/bas/string.h>
#include <xp/bas/stdio.h>

int xp_main ()
{
	xp_char_t buf[6];

	xp_printf (XP_TEXT("[%u]\n"), 
		(unsigned)xp_strcpyn (buf, XP_TEXT("this"), xp_countof(buf)));
	xp_printf (XP_TEXT("[%s]\n"), buf);

	xp_printf (XP_TEXT("[%u]\n"), 
		(unsigned)xp_strcpyn (buf, XP_TEXT("this is good"), xp_countof(buf)));
	/* may print a lot of garbage as buf is not null-terminated. */
	xp_printf (XP_TEXT("[%s]\n"), buf); 

	return 0;
}
